{extend name="public:layout" /}
{block name="title"}修改字段{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> <a href="{:url('CmsMoudle/index')}"> 模型管理</a></li>
                <li><a href="{:url('index',['mid'=>$info['mid']])}"> 字段列表</a></li>
                <li class="active">修改字段</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <input type="hidden" name="fid" value="{$info.fid}"/>
                <input type="hidden" name="mid" value="{$info.mid}"/>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">字段标题</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入字段标题"
                               name="title" value="{$info.title}" datatype="*"/>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">字段类型</label>
                    <div class="col-sm-4">
                        <p class="form-control-static">{$info.field_type}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">归属表</label>
                    <div class="col-sm-4">
                        <p class="form-control-static">
                            {eq name="info.table_type" value="1"}主表{else/}附表{/eq}
                        </p>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">字段名</label>
                    <div class="col-sm-4">
                        <p class="form-control-static">{$info.field_name}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">排序</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control"
                               name="field_sort" value="{$info.field_sort}" datatype="n"/>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">字段提示</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入字段提示"
                               name="tips" value="{$info.tips}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">验证规则</label>
                    <div class="col-sm-10">
                        {foreach $validRule as $key=>$value}
                        <label class="checkbox-inline i-checks">
                            <input type="checkbox" name="validate[]" value="{$key}"
                                   {in name="key" value="$info['validate']" }checked{/in} /> {$value}
                        </label>
                        {/foreach}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">验证时机</label>
                    <div class="col-sm-10">
                        <label class="checkbox-inline i-checks">
                            <input type="radio" name="validate_scene" value="0"
                                   {eq name="info.validate_scene" value="0" }checked{/eq} /> 不验证
                        </label>
                        <label class="checkbox-inline i-checks">
                            <input type="radio" name="validate_scene" value="1"
                                   {eq name="info.validate_scene" value="1" }checked{/eq} /> 添加
                        </label>
                        <label class="checkbox-inline i-checks">
                            <input type="radio" name="validate_scene" value="2"
                                   {eq name="info.validate_scene" value="2" }checked{/eq} /> 编辑
                        </label>
                        <label class="checkbox-inline i-checks">
                            <input type="radio" name="validate_scene" value="3"
                                   {eq name="info.validate_scene" value="3" }checked{/eq} /> 添加编辑
                        </label>
                    </div>
                </div>
                <div id="fieldTpl">
                    {$setField}
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" id="btnSub" type="button">保存内容</button>
                        <a href="{:url('index',array('mid'=>$moudleInfo['mid']))}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub');
    })
</script>
{/block}